import { getToken, setToken, removeToken} from '@/utils/auth.js'
const state = {
    token: getToken(),
}
const mutations = {
    // 设置token
    setToken(state, pyload) {
        state.token = pyload;
        setToken(pyload)
    },
    // 删除缓存
    removeToken(state) {
        state.token=""
        removeToken() 
    },
}
const actions = {}

export default {
    namespaced: true,
    state,
    mutations,
    actions
}